package com.ybwh.tranformData;

//import com.fasterxml.jackson.annotation.JsonValue;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSON;

/**
 * @author weiyuqing
 * @description
 * @date 2018/7/2 10:34
 **/

//岗位序列枚举类
public enum PosSeqType {
    xmhx(1, "项目核心"),
    xshx(2, "销售核心"),
    zn(3, "职能"),
    hd(4, "后端"),
    cy(5, "产研"),
    hx(6, "核心"),
    qt(7, "其他（外包，渠道）"),;

    private Integer id;
    private String name;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map<String, Object> toMap(){
        Map<String, Object> map = new HashMap<>();
        map.put("id", getId());
        map.put("name", getName());
        return map;
    }


    PosSeqType(Integer id, String name) {
        this.id = id;
        this.name = name;
    }
    public static String getNameById(Integer id) {
        for (PosSeqType p : PosSeqType.values()) {
            if (p.getId() == id) {
                return p.getName();
            }
        }
        return "";
    }

    public static Integer getIdByName(String name){
        for (PosSeqType p : PosSeqType.values()) {
            if (p.getName().equals(name)) {
                return p.getId();
            }
        }
        return -1;
    }


    
    
    public static void main(String[] args) {
		System.out.println(PosSeqType.values());
		System.out.println(JSON.toJSON(PosSeqType.values()));
		
		String columnsAttendDetail[] = {"dateStr", "employeeId", "workStatusStr", "bpoStr", "idNum", "fillInfoDateStr", "areaStr", "odArea", "posSeqStr",
		            "posBaseSeq", "name", "source", "division", "name1", "name2", "name3", "name4", "name5", "name6", "pos", "posDivideStr",
		            "schExceptionStatusStr", "unpunctualTimes",
		            "uncheckedTimes", "noAttendDays", "annualLeave", "casualLeave",
		            "businessLeave", "sickLeave", "maternityLeave",
		            "antenatalLeave", "paternityLeave", "marriageLeave",
		            "bereavementLeave", "collateralFuneralDays", "injueryDays",
		            "overtimeDays", "averageHours", "leaveDays",
		            "shouldAttendDays", "realAttendenceDays", "daysAttendOfTrain", "daysAttendOfInternship", "overtimePay",
		            "lateMinute"};

		 String columnsNameAttendDetail[] = {"日期", "员工ID", "任职状态", "bpo", "身份证号", "基本资料填写日期", "地域隶属", "OD隶属", "岗位序列",
		            "岗位基础序列", "姓名", "源目录", "事业部", "一级部门", "二级部门", "三级部门", "四级部门", "五级部门", "六级部门", "岗位", "岗位划分",
		            "排班异常", "迟到早退次数", "未打卡次数", "未打卡天数", "年假",
		            "事假", "公出", "病假", "产假", "产检假", "陪产假", "婚假", "直系丧假天数", "旁系亲属丧假",
		            "工伤假", "调休天数", "平均工时", "请假天数", "应出勤天数", "实际出勤天数", "参培期出勤天数", "实习期出勤天数", "加班费",
		            "迟到早退时长"};
		 
		 System.out.println(columnsAttendDetail.length+"---"+columnsNameAttendDetail.length);
		
	}
}
